/** 
 ** Copyright (c) 2010 Boskoi
 ** All rights reserved
 ** Contact: developer@boskoi.org
 ** Developers: Joey van der Bie, Maarten van der Mark and Vincent Vijn
 ** Website: http://www.boskoi.org
 ** 
 ** GNU Lesser General Public License Usage
 ** This file may be used under the terms of the GNU Lesser
 ** General Public License version 3 as published by the Free Software
 ** Foundation and appearing in the file LICENSE.LGPL included in the
 ** packaging of this file. Please review the following information to
 ** ensure the GNU Lesser General Public License version 3 requirements
 ** will be met: http://www.gnu.org/licenses/lgpl.html.	
 **	
 **
 ** If you have questions regarding the use of this file, please contact
 ** Boskoi developers at developer@boskoi.org.
 ** 
 **/

package org.boskoi.android;

import org.boskoi.android.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;


public class LargeImageView extends Activity {
	
	private ImageView img;
	
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        BoskoiService.trackPageView(LargeImageView.this,"/LargeImage");
        setContentView( R.layout.large_image_view);
        img = (ImageView) this.findViewById(R.id.ImageView);
        
        Bundle extras = getIntent().getExtras();
        String[] thumbnails = extras.getStringArray("ImageName");
        
        ImageManager.saveImage( thumbnails[0].replace("_t",""));

        img.setImageDrawable(ImageManager.getImages(thumbnails[0].replace("_t","")));
		img.setOnTouchListener(new View.OnTouchListener() {
			
			public boolean onTouch(View v, MotionEvent event) {
				finish();
        		return true;
			}
		});
        img.setOnClickListener( new View.OnClickListener() {  
        	public void onClick( View v ) {
        		finish();
        	}
        });       
	}
	
	@Override
	public void onResume(){
		super.onResume();
		BoskoiService.trackPageView(LargeImageView.this,"/LargeImage");
	}
}
